package xzy.dao;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import xzy.pojo.Grade;
import xzy.pojo.Student;

import java.util.List;
@Repository("studentMapper")
public class StudentMapperImpL implements StudentMapper {
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
    public List<Student> findAllStudent() {
        return sqlSessionTemplate.getMapper(StudentMapper.class).findAllStudent();
    }

    public Student findStudentByName(String name) {
        return sqlSessionTemplate.getMapper(StudentMapper.class).findStudentByName(name);
    }

    public int addStudent(Student student) {
        return sqlSessionTemplate.getMapper(StudentMapper.class).addStudent(student);
    }

    public int updateStudent(Student student) {
        return sqlSessionTemplate.getMapper(StudentMapper.class).updateStudent(student);
    }
}
